<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-08-08 14:55:13
 * @LastEditTime : 2020-01-14 14:44:12
 * @LastEditors  : Please set LastEditors
 -->
<style scoped>
.headerBtn{
    text-align: left;
    margin: 15px 0;
}
.pageStyle{
    text-align:right;
    float:right;
}
.ivu-table-wrapper{
    overflow:visible
}
.pageStyleVm{
    text-align: center;
}
table .ivu-poptip-confirm .ivu-poptip-body .ivu-icon{
    left: 11px
}
.position_i{
    position: relative;
    top: -1px;
    margin-right: 5px
}
/* td{
    border-right: 0 !important
} */
.ivu-table-tip{
    overflow: hidden !important;
}
.starlet{
    color: red;
    position: absolute;
    left: -60px;
    font-size: 18px;
    line-height: 38px;
    font-weight: 800;
}
.zIndexStyleBtn{
    position:relative;
    z-index:55
}
ul li{
    list-style: none
}
._dot{
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f90;
    margin-right: 5px
}
</style>
<style>
	.btnCenter .ivu-poptip-confirm .ivu-poptip-body{
		text-align:left;
	}
</style>
<template>
    <search-table
	    ref="searchTable"
		:columns="taskCol" 
        :data="taskData"
		:total="taskTotal"
		:page.sync="taskCurrentPage"
		:size.sync="taskItemPage"
		@change-size="switchTaskItemPage"
		@change-page="switchineTaskCurrentPage"
        :showPage="false"
	>
    <Alert type="warning" show-icon slot="alert">
        <p style="color:#f90">配置此任务需要满足的条件:</p>
        <p>	1.环境部署成功</p>
        <p>	2.竞赛团队配置完成</p>
        <p>	3.所选题目中含有需要环境、需要提交Flag且Flag类型为静态Flag的题目</p>
        <p>	4.题目分配完成</p>
        <p v-if="type != 2">	5.一定要配置提交任务，否则实验员看不到攻击的靶标</p>
    </Alert>
    <template slot="search">
        <Button type="primary" ghost @click="createFlagTask" class="zIndexStyleBtn" :disabled="disabledAllBtn"  style="margin-right:15px;"><Icon type="ios-add" :size="16" class="position_i"/>添加任务</Button>
        <Button type="primary" ghost @click="autoConfig()" class="zIndexStyleBtn" :disabled="!canAutoConfig || taskTotal >= 1 || disabledAllBtn" style="margin-right:15px;"><img src="../../../../assets/scene/auto-target-allot-purple.png" alt="" />一键配置</Button>
    </template>
        <Modal
            v-model="createFlagTaskModal"
            title="Flag单次提交(只有存在验证类型是静态Flag的靶标,才需要创建此任务)"
            ok-text = "确定"
            :loading = createFlagTaskModalLoading
            width=600
            @on-ok="ok"
            @on-cancel="cancel">
            <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
                <FormItem label="名字" prop="name">
                    <Input v-model.trim="formValidate.name" placeholder="请输入名称" clearable :maxlength="64"></Input>
                </FormItem>
                <!--<FormItem label="类型" prop="taskMode">
                    <RadioGroup v-model="formValidate.taskMode">
                        <Radio label="normal" :disabled="disabledTepBol">流程任务</Radio>
                        <Radio label="preset" :disabled="disabledTepBol">预设临机任务</Radio>
                        <Radio label="temp" :disabled="!disabledTepBol">实时任务</Radio>
                    </RadioGroup>
                </FormItem>-->
                <FormItem  label="用时" prop="duration">
	                <InputNumber :min="1"  v-model="formValidate.duration" style="width:200px"></InputNumber> （秒）
	            </FormItem>
                <FormItem v-model="formValidate.selectedVmData"  label="人员设备">
                    <span class="starlet" style="left:-70px">*</span>
                    <input type="hidden" >
                    <!--<Tag v-for="item in formValidate.selectedVmData" :key="item.id" :name="item.id" closable @on-close="handleClose2" color="primary" type='dot' >{{ item.name }}</Tag>-->
                	<!--{{showUserDevices}}-->
                	<Row v-for="userDevice in showUserDevices" :key="userDevice.groupId">
            			<div>接入组：<Tag color="blue">{{userDevice.groupName}}</Tag></div>
            			<div>人员：<Tag color="default" v-for="user in userDevice.userList" :key="user.userId">{{user.userName}}</Tag></div>
            			<div>子网络：<Tag color="blue">{{userDevice.networkName}}</Tag></div>
            			<div>设备：<Tag color="default" v-for="device in userDevice.deviceList" :key="device.deviceId">{{device.deviceName}}</Tag></div>
                	    <Divider dashed style="margin:10px 0"/>
                	</Row>
                </FormItem>
                <FormItem label="接入组" prop="group">
                    <Select filterable v-model="formValidate.group" filterable   clearable placeholder="请选择人员" @on-change="getAccessGroupMember" >
                        <Option v-for="(item,index) in accessGroupList" :key="index" :value="JSON.stringify(item)" :label="item.name" :title="item.name">{{item.name}}</Option>
                    </Select>
                    <div v-if="vmAttributeData.length > 0 && formValidate.group">
	                	<Tag color="default" v-for="user in vmAttributeData" :key="user.userId">{{user.userName}}</Tag>
	                </div>
	                <small v-if="vmAttributeData.length == 0 && formValidate.group" style="color:#f00">接入组人员不能为空，请先分配人员</small>
                </FormItem>
                <!--{{vmAttributeData}}-->
                <!--<FormItem label="人员" prop="peopleValue">-->
                    <!-- <Cascader :data="vmAttributeData"   placeholder="请选择人员" multiple v-model="peopleValue"></Cascader>  -->
                    <!-- <cascaderMulti :data="vmAttributeData"   placeholder="请选择人员" multiple v-model="peopleValue"></cascaderMulti>  -->
                    <!--<Select filterable v-model="peopleValue" filterable   clearable placeholder="请选择人员" multiple>
                        <Option v-for="(item,index) in vmAttributeData" :key="item.userId" :value="item.id+','+item.userId" >{{item.name}}-{{item.userName}}</Option>
                    </Select>
                </FormItem>-->
                <FormItem label="子网" prop="networkArr" v-show="formValidate.group">
	                <Select filterable v-model="networkArr" :transfer="true" @on-change="changeNetwork" multiple>
				        <Option v-for="item in availableSubnetList" :value="item.id" :key="item.id" :title="item.name">{{ item.name }}</Option>
				    </Select>
				    <div v-if="currentDevice.length > 0 && networkArr.length > 0">
	                	<Tag color="default" v-for="device in currentDevice" :key="device">{{getNameFormId[device]}}</Tag>
	                </div>
	                <small v-if="currentDevice.length == 0 && networkArr.length > 0" style="color:#f00">无可用设备，请查看靶标是否已经分配，工程是否部署成功</small>
			    </FormItem>
			    <!--{{currentDevice}}-->
                <!--<FormItem label="设备" prop="way">
                     <Select filterable v-model="currentDevice" filterable   clearable placeholder="请选择设备" multiple>
                        <Option v-for="(item,index) in deviceList" :key="item.id" :value="item.id" >{{item.name}}</Option>
                    </Select>
                </FormItem>-->
                <FormItem style="text-align:center">
                     <Button @click="commitTask"   long type="warning" ghost>提交</Button>
                </FormItem>
                <!-- <div style="text-align:right">
                    <Button type="primary" @click="addSelectedData" style="margin-right:17px">添加</Button>
                    <Input placeholder="请输入名称" style="width: 210px" v-model="formValidate.vmName" clearable></Input>
                    <Input placeholder="请输入IP" style="width: 210px" v-model="formValidate.vmIP" clearable></Input>
                    <Button type="primary" @click="refreshVmList" style="margin-left:5px">搜索</Button>
                </div>
                <Table border ref="" :columns="columnsVmList" :data="dataVmList"  :stripe="showStripe" :show-header="showHeader" :size="tableSize" style="margin-top:10px" @on-selection-change="getSelectedData"></Table>
                <Page :total="vmTotal"   :current="vmCurrentPage" :page-size="vmItemPage" :show-total= true  @on-change="switchineVmCurrentPage" @on-page-size-change="switchVmItemPage" class-name="pageStyleVm"/> -->
                <!--<FormItem label="属性" >
                    <cusAttribute ref="cusAttribute" @func="getMsgFormSon" v-bind:msgVal="propertiesData" v-if="createFlagTaskModal"></cusAttribute>
                </FormItem>
                <FormItem label="描述" prop="desc" style="margin-top:10px">
                    <Input v-model.trim="formValidate.desc" type="textarea" :autosize="{minRows: 2,maxRows: 5}" placeholder="请输入内容" clearable :maxlength="200"></Input>
                </FormItem>-->
            </Form>
        </Modal>
        <Modal
            v-model="taskDeailModal" footer-hide
            title="任务启动详情"
            width = '80'
            >
            <Table border ref="" :columns="taskDeailColumns" :data="taskDeailData"  :stripe="showStripe" :show-header="showHeader" :size="tableSize" @on-expand="hostDeail"></Table>
        </Modal>
    </search-table>
</template>
<script>
//import axios from '@/libs/api.request'
// import qgaWriteCollect from '@/components/configer/qgaWriteCollect'
import $ from 'jquery'
import cusAttribute from '@/view/drill_compete/page/cusAttribute'
import {saveoutbandTask,getTaskList,deleteTask,updateTask,amendTask,activeTask,taskDetail,taskDetailHis,deleteManyTask,hostDetail,getTaskListDetailData,showConfiguration,getDeviceList,loadItemConfiguration,getFlagOnceDetail,getstatusbyprjid} from '@/api/drill'
import {queryTargetAllot,getSceneInfo,queryNetworkList,queryVmWithParty,queryCtfTargetAllot} from '@/api/drill_compete'
import {getaccessgrouplist,getUserDevices} from '@/api/access_new'
import { taskCol } from './taskMixin';
const validateName = (rule, value, callback) => {
    var myReg = /[~!！@#$%^&*()/\|,<>?"'“‘();:+=\[\]{}]/;
    value = value.replace(/\s*/g,"");
    if(!value){
        callback("请填写名字");
    }else{
        if (myReg.test(value)) {
            callback("名字不能包含特殊字符");
        } else {
            callback();
        }
    }
};
const validateNum = (rule, value, callback) => { //验证只能填入数字
  	var reg = new RegExp("^([1-9]|[1-9]\\d|100)$");
  	//验证警戒值
  	if(value){
  		if (!reg.test(value)) {
  			callback(new Error('请输入1-100的整数'));
  		}else{
  			callback()
  		}
  	}else{
  		callback()
  	}
  }
export default {
    name:"flagVm",
    props:['type','onlineMode','disabledAllBtn'],
    mixins:[taskCol],
    components:{
       //qgaWriteCollect
       cusAttribute
    },
    data(){
        return{
            tableHeight:'',
            taskConfigerMess:false,
            currentProjectId:"",
            taskTypeTable:'once_submit_flag',
            taskTypeTableTitle:"Flag服务器",
            selectedData:[],
            selectedDataConfiger:[],
            headerData:{
            	serintervalTimeFun:{}
            },
            // amendTaskId:"",
            accessGroupList:[],
            networkArr:[],
            subnetList:[],
            availableSubnetList:[],
            projectInfo:{},
            columnsData: [
//              {
//                  type: 'selection',
//                  width: 60,
//                  align: 'center',
//
//              },
                {
                    title: this.$t('name'),
                    key: 'name',
                    align:'center',
                    placement:'top-left',
                },
                // {
                //     title: 'TaskType',
                //     key: 'taskType',
                //      align:'center'
                // },
                // {
                //     title: this.$t('ConfigurationName'),
                //     key: 'configName',
                //     align:'center'
                // },
                // {
                //     title: 'id',
                //     key: 'id',
                //     visible:false
                // },
                {
                    title: this.$t('creatorName'),
                    key: 'creatorName',
                     align:'center',
                     width:100,
                     tooltip:true
                },
                {
                    title: this.$t('CTime'),
                    key: 'created',
                     align:'center'
                },
//              {
//                  title:this.$t('Desc'),
//                  key:'description',
//                  align:'center'
//              },
                {
                    title: this.$t('Status'),
                    key: 'status',
                    align:'center',
                    width:130,
                    placement:'top-right',
                    render:(h,params)=>{
                        switch (params.row.status) {
                            case "running":
                                return h('Tag',{
                                    props:{
                                        type:'border',
                                        color:'success'
                                    },
                                },'运行中')
                                break;
                            case "error":
                            case "failed":
                                return h('Tag',{
                                    props:{
                                        type:'border',
                                        color:'error'
                                    },
                                },'失败')
                                break;
                            case "completed":
                                return h('Tag',{
                                    props:{
//                                      text:'完成',
                                        type:'border',
                                        color:'primary'
                                    },
                                },'完成')
                                break;
                            case "initialized":
                                return h('Tag',{
                                    props:{
//                                      text:'初始化',
                                        type:'border',
                                        color:'default'
                                    },
                                },'初始化')
                                break;
                            case "starting":
                                return h('Tag',{
                                    props:{
//                                      text:'启动中',
                                        type:'border',
                                        color:'success'
                                    },
                                },'启动中')
                                break;
                            case "closing":
                                return h('Tag',{
                                    props:{
//                                      text:'关闭中',
                                        type:'border',
                                        color:'success'
                                    },
                                },'关闭中')
                                break;
                            default:
                                break;
                        }
                    }

                },
                {
                    title:this.$t('Details'),
                    key:'',
                    align:'center',
                    // minWidth:140,
                    render:(h,params)=>{
                        let statics = params.row.overview;
                        let statusGroup = [];
                        if(JSON.stringify(statics) != "{}"){
                            for(let i in statics){
                                statusGroup.push(h('span',{},i+':'+statics[i]))
                            }
                        }
                        // console.log(statusGroup)
                        return h('span',{},statusGroup)
                    }
                },
                {
                    title:this.$t('operation'),
                    key:'-',
                    align:'center',
                    width:350,
                    placement:'top-right',
                    action:true,
                    render:(h,params)=>{
                        let  _this = this;
                        let taskStatus = null
                        let taskBtnType = null
                        let btnStyle = null;
                        if(params.row.taskMode=="normal"){
                            btnStyle = "none"
                        }else{
                            btnStyle = "inline-block"
                        }
                        switch (params.row.status) {
                            case "initialized":
                                taskStatus = "开始"
                                taskBtnType = "success"
                                break;
                            case "error":
                            case "failed":
                                taskStatus = "开始"
                                taskBtnType = "success"
                                break;
                            case "running":
                                taskStatus = "停止"
                                taskBtnType = "error"
                                break;
                            case "completed":
                                taskStatus = "开始"
                                taskBtnType = "success"
                                break;
                            case "starting":
                                taskStatus = "停止"
                                taskBtnType = "error"
                                break;
                            case "closing":
                                taskStatus = "停止"
                                taskBtnType = "error"
                                break;
                             case "stop_error":
                                taskStatus = "停止"
                                taskBtnType = "error"
                                break;
                            default:
                                break;
                        }
                        return h("div",{
                        	attrs:{
                        		class:'btnCenter'
                        	}
                        },[
                            h('Poptip',{
                                props:{
                                    confirm:true,
                                    title:"您确定要删除此任务吗？",
                                    transfer:true
                                },
                                on:{
                                    'on-ok':()=>{
                                        _this.deleteTask(params.row.id)
                                    },
                                    'on-cancel':()=>{

                                    }
                                }
                            },[h('Button',{
                                props:{
                                    type:'error',
                                    size:'small',
                                    disabled:this.disabledAllBtn
                                },
                                attrs:{
                                	title:'删除'
                                },
                                style:{
                                   border:'none',
									background:'none',
									boxShadow:'none',
                                },
                                },[
                                	h('img', {
				                        attrs: {
				//                          src: !this.setReBtnStatus(params.row) ?require('../../../assets/globalIcon/del.png'):require('../../../assets/globalIcon/dis-del.png'),
				                        	src:this.disabledAllBtn ? require('../../../../assets/project/delNote-d.png') : require('../../../../assets/project/delNote-h.png')
				                        },
				                        style: {
				                            cursor: 'pointer',
//				                            'margin-right':'5px',
				                            'vertical-align': 'middle',
//				                            width:'16px',
//				                            height:'auto',
				                            display:'inline-block',
				                            marginBottom:'4px',
				                        },
				                    }),
//				                    h('span',{
//				                        style: {
//				                            cursor: 'pointer',
//				//                          color:!this.setReBtnStatus(params.row) ? '#2d8cf0' : '#c5c8ce'
//											color:'#2d8cf0'
//				                        },
//				                    },'删除')
                                ])]),
                            h('Button',{
                                props:{
                                    type:"text",
                                    size:'small',
                                    disabled:this.disabledAllBtn
                                },
                                attrs:{
                                	title:'修改'
                                },
                                style:{
                                    border:'none',
									background:'none',
									boxShadow:'none',
                                },
                                on:{
                                    click:()=>{
                                        _this.updateTask(params.row.id)
                                    }
                                }
                            },[
                            	h('img', {
			                        attrs: {
			//                          src: !this.setReBtnStatus(params.row) ? require('../../../assets/globalIcon/modify.png'):require('../../../assets/globalIcon/dis-modify2.png'),
			                        	src:this.disabledAllBtn ? require('../../../../assets/project/modifys.png') : require('../../../../assets/project/modifys-h.png')
			                        },
			                        style: {
			                            cursor: 'pointer',
//			                            'margin-right':'5px',
			                            'vertical-align': 'middle',
//			                            width:'16px',
//			                            height:'auto',
			                            display:'inline-block',
			                            marginBottom:'4px',
			                        },
			                    }),
//			                    h('span',{
//			                        style: {
//			                            cursor: 'pointer',
//			//                          color:!this.setReBtnStatus(params.row) ? '#2d8cf0' : '#c5c8ce'
//										color:'#2d8cf0'
//			                        },
//			                    },'修改')
                            ]),
                            h('Poptip',{
                                props:{
                                    confirm:true,
                                    title:"您确定要"+taskStatus+"此任务吗？",
                                    transfer:true
                                },
                                on:{
                                    'on-ok':()=>{
                                        _this.activeTask(params.row.id,taskStatus)
                                    },
                                    'on-cancel':()=>{

                                    }
                                }
                            },[h('Button',{
                                props:{
                                    //type:taskBtnType,
                                    type:'text',
                                    size:'small',
                                    disabled:this.disabledAllBtn
                                },
                                title:{
                                	title:taskStatus+'任务'
                                },
                                style:{
                                    border:'none',
									background:'none',
									boxShadow:'none',
                                    display:btnStyle
                                },
                                },[
                                	h('img', {
				                        attrs: {
				//                          src: !this.setReBtnStatus(params.row) ? require('../../../assets/globalIcon/modify.png'):require('../../../assets/globalIcon/dis-modify2.png'),
				                        	src:taskStatus == '停止' ? (this.disabledAllBtn ? require('../../../../assets/scene/dis-stop-task.png') : require('../../../../assets/scene/stop-task.png')) : (this.disabledAllBtn ? require('../../../../assets/scene/dis-start-task.png') : require('../../../../assets/scene/start-task.png'))
				                        },
				                        style: {
				                            cursor: 'pointer',
	//			                            'margin-right':'5px',
				                            'vertical-align': 'middle',
	//			                            width:'16px',
	//			                            height:'auto',
				                            display:'inline-block',
				                            marginBottom:'4px',
				                        },
				                    }),
				                    h('span',{
				                        style: {
				                            cursor: 'pointer',
				//                          color:!this.setReBtnStatus(params.row) ? '#2d8cf0' : '#c5c8ce'
											color:'#2d8cf0'
				                        },
				                    })//,taskStatus+'任务'
                                ])]),
                            //     h('Poptip',{
                            //     props:{
                            //         confirm:true,
                            //         title:"您确定要初始化此任务吗？",
                            //     },
                            //     on:{
                            //         'on-ok':()=>{
                            //             _this.activeTask(params.row.id,"init")
                            //         },
                            //         'on-cancel':()=>{

                            //         }
                            //     }
                            // },[h('Button',{
                            //     props:{
                            //         type:"info",
                            //         size:'small'
                            //     },
                            //     style:{
                            //         margin:'5px'
                            //     },
                            //     },'初始化任务')]),
                                h('Button',{
                                props:{
                                    type:"primary",
                                    size:'small'
                                    // style:{margin:'10px'}
                                },
                                style:{
                                   border:'none',
									background:'none',
									boxShadow:'none',
                                },
                                on:{
                                    click:()=>{
                                        _this.taskDeail(params.row.id)
                                    }
                                }
                            },[
                            	h('img', {
			                        attrs: {
			//                          src: !this.setReBtnStatus(params.row) ? require('../../../assets/globalIcon/modify.png'):require('../../../assets/globalIcon/dis-modify2.png'),
			                        	src:require('../../../../assets/project/magnifier-h.png')
			                        },
			                        style: {
			                            cursor: 'pointer',
//			                            'margin-right':'5px',
			                            'vertical-align': 'middle',
//			                            width:'16px',
//			                            height:'auto',
			                            display:'inline-block',
			                            marginBottom:'4px',
			                        },
			                    }),
			                    h('span',{
			                        style: {
			                            cursor: 'pointer',
			//                          color:!this.setReBtnStatus(params.row) ? '#2d8cf0' : '#c5c8ce'
										color:'#2d8cf0'
			                        },
			                    })//,'查看详情'
                            ]),
                        ])
                    }

                }
            ],
            taskData: [

            ],
            columnsVmList:[
                {
                    type:'selection',
                    width:60,
                    align:'center'
                },
                {
                    title:this.$t('name'),
                    key:'name',
                    align:'center'
                },
                {
                    title:'IP',
                    key:'IP',
                    align:'center',
                    render:(h,params)=>{
                        let value = params.row.IP;
                        let oIP_ = [];
                        $.each(value,(i,item)=>{
                            oIP_.push(h("p",{
                                color:'#000',
                            },item))
                        })
                        return h("div",oIP_)
                    }
                },
                {
                    title:this.$t('SystemType'),
                    key:'sysType',
                    align:'center',
                },
                {
                    title:this.$t('Add'),
                    key:'add',
                    align:'center',
                    width:80,
                    render:(h,params) =>{
                        let _this = params;
                        return h('Button', {
                            props: {
                                type: 'primary',
                            },
                            on:{
                                click: (e) => {
                                    if(this.selectedVmDataTable.indexOf(_this.row.id)!=-1){
                                        this.$Message.info("已添加")
                                        return;
                                    }
                                    // alert('-')
                                    this.addVmAfterTable(_this.row)
                                    this.selectedVmDataTable.push(_this.row.id)
                                    this.formValidate.selectedVmData.push({
                                        "name":_this.row.name,
                                        "id":_this.row.id
                                    })
                                },
                            }
                        }, "+");
                    }
                }
            ],
            dataVmList:[

            ],
            selectedVmDataTable:[

            ],
            configurationData:[

            ],
            createFlagTaskModalLoading:true,
            showBorder: false,
            showStripe: true,
            showHeader: true,
            showIndex: true,
            showCheckbox: false,
            fixedHeader: false,
            tableSize: 'small',
            createFlagTaskModal : false,
            formValidate: {
                name: '',
                configer: '',
                osType:'',
                path:'',
                category:'',
                type:'',
                content:'',
                selectedVmData:[

                ],
                desc: '',
                vmName:'',
                vmIP:'',
                taskMode:'preset',
                access:'true',
                path:'',
                way:'ssh',
                duration:1
            },
            ruleValidate: {
                name: [
                    { required: true, message: '', trigger: 'change',validator:validateName }
                ],
//              taskMode: [
//                 { required: true, message: '', trigger: 'change'}
//              ],
                expireTime: [
                   { required: true, message: '', trigger: 'change'}
                ],
                secret: [
                   { required: true, message: '', trigger: 'change'}
                ],
                configer: [
                    { required: true, message: '请选择配置', trigger: 'change'},
                ],
                duration: [
                    { required: true, type:'number',message: '不能为空', trigger: 'change'},//validator:validateNum
                ],
                // selectedVmData:[
                //     // {required:true ,message:"请选择虚拟机"}
                // ],
                desc: [

                ]
            },
            vmCurrentPage:1,
            vmItemPage:10,
            vmTotal:0,
            taskCurrentPage:1,
            taskItemPage:10,
            taskTotal:0,
            judgePanelType:true,//判断是修改还是保存
            workingAreaTaskId:"",//存放修改的任务id

            //查看详情面板
            taskDeailModal:false,
            taskDeailColumns:[
//              {
//                  type:"expand",
//                  width:30,
//                  render: (h, params) => {
//                      return h('div',{},[
//                          h('Row',{props:{class:'expand-row'}},[
//                              h('Col',{props:{span:'8'},style:{width:'50%'}},[
//                                  h('span',{props:{class:'expand-key'}},'宿主机名称:  '),
//                                  h('span',{props:{class:'expand-value'}},params.row.host)
//                              ]),
//                              h('Col',{props:{span:'8'},style:{width:'50%'}},[
//                                  h('span',{props:{class:'expand-key'}},'宿主机ip:  '),
//                                  h('span',{props:{class:'expand-value'}},params.row.hostIp)
//                              ]),
//                          ]),
//                          h('Row',{props:{class:'expand-row'}},[
//                              h('Col',{props:{span:'8'},style:{width:'50%'}},[
//                                  h('span',{props:{class:'expand-key'}},'实例名称:  '),
//                                  h('span',{props:{class:'expand-value'}},params.row.instance)
//                              ]),
//                              h('Col',{props:{span:'8'},style:{width:'50%'}},[
//                                  h('span',{props:{class:'expand-key'}},'ip:  '),
//                                  h('span',{props:{class:'expand-value'}},params.row.IP)
//                              ]),
//                          ]),
//                          h('Row',{props:{class:'expand-row'},},[
//                              h('Col',{props:{span:'8'},style:{width:'50%'}},[
//                                  h('span',{props:{class:'expand-key'}},'cidr:  '),
//                                  h('span',{props:{class:'expand-value'}},params.row.cidr)
//                              ]),
                                // h('Col',{props:{span:'8'},style:{width:'50%'}},[
                                //     h('span',{props:{class:'expand-key'}},'网络名称:  '),
                                //     h('span',{props:{class:'expand-value'}},params.row.networkName)
                                // ]),
//                          ]),
//                      ])
//                  }
//              },
                {
                    title:'用户',
                    key:'userName',
                    align:'center'
                },
                {
                    title:'接入组',
                    key:'accessGroupId',
                    align:'center'
                },
                {
                    title:'状态',
                    key:'status',
                    align:'center'
                },
                {
                    title:'设备名称',
                    key:'deviceName',
                    align:'center'
                },
//               {
//                  title:this.$t('CTime'),
//                  key:'created',
//                  align:'center'
//              },
//              {
//                  title:this.$t('LastUpdate'),
//                  key:'updated',
//                  align:'center'
//              },{
//                  title:this.$t('Message'),
//                  key:'message',
//                  align:'center'
//              },
                // {
                //     title:'operation',
                //     key:'-',
                //     align:'center',
                //     render:(h,params)=>{
                //         return h("Button",{
                //             props:{
                //                 type:'primary'
                //             }
                //         },"查看结果")
                //     }
                // }
            ],
            taskDeailData:[],

            optionHoverEvent:null,
            optionOutEvent:null,
            configurationInformation:false,
            cardPanelLeft:'3px',
            cardPanelTop:'3px',
            configPanel:{
                configPath:'',
                configSystype:'',
                configContent:'',
                configDescription:'',
                configCreateTime:'',
                configCreatorName:'',
                configName:'',
            },
            hoverCdraBol:false,
            boxShadow:'5px 5px 5px #ddd',
            configerParams:false,//回显配置详细信息
            metadataConfigerInfor:{},
            configerSystype:'',
            currentSceneId:'',
            propertiesData:[],
            vmAttributeData:[],
            deviceList:[],
            currentDevice:[],//设备数据
            peopleValue:[],//人员数据
            currentUsers:[],//保存时数据
            getNameFormId:{},//id和名称对应集合
            userDeciceGroupId:[],//判断是否已经存在
            currentTaskMode:'preset',
            disabledTepBol:false,
            canAutoConfig:false
        }
    },
    //props: ['headerData'],
    computed:{
    	showUserDevices:function(){
    		let splitData = this.formValidate.selectedVmData.map(vm => {
    			let nameArr = vm.name.split('/');
    			let idArr = vm.id.split(',');
    			return {
    				groupId:idArr[0],
    				userId:idArr[1],
//  				netWorkId:idArr[2],
    				deviceId:idArr[2],
    				groupName:nameArr[0],
    				userName:nameArr[1],
    				networkName:nameArr[2],
    				deviceName:nameArr[3]
    			}
    		})
    		let groupObj = {};
    		splitData.forEach(item => {
    			if(!groupObj[item.groupId]){
    				groupObj[item.groupId] = {
    					groupId:item.groupId,
    					groupName:item.groupName,
    					userList:[{
    						userId:item.userId,
    						userName:item.userName
    					}],
    					networkName:item.networkName,
    					deviceList:[{
    						deviceId:item.deviceId,
    						deviceName:item.deviceName
    					}]
    				}
    			}else{
    				if(groupObj[item.groupId].userList.filter(user => user.userId == item.userId).length  == 0){
	    				groupObj[item.groupId].userList.push({
	    					userId:item.userId,
	    					userName:item.userName
	    				})
    				}
    				if(groupObj[item.groupId].deviceList.filter(device => device.deviceId == item.deviceId).length  == 0){
    					groupObj[item.groupId].deviceList.push({
	    					deviceId:item.deviceId,
	    					deviceName:item.deviceName
	    				})
    				}
    			}
    		})
    		console.log(groupObj);
    		return Object.values(groupObj)
    	}
    },
    created(){
         this.currentProjectId = this.$route.query.prjid
         this.currentSceneId = this.$route.query.id
         //this.tableHeight = $(window).height() - 222 ;
        //  this.currentProjectId = "af47d0f5b3964c59a1d5673b85050409"
        //  this.currentProjectId = "c0bf5e6e55734ab59b5f18632c4c9f0a"
        //  localStorage.token = "89bcd9227f6a4f599d2c9c44b310f50f"
        this.getProjectInfo().then(() => {
        	//一键配置条件判断
	        this.getProjectSubnet().then(data => {
	        	Promise.all([this.getAccessUserGroup(),this.refreshVmList()]).then(data => {
		        	this.dealAutoConfigData();
		        })
	        })
        });
        //获取演练详情，设置用时
        getSceneInfo(this.currentSceneId).then(data => {
        	if(data.code == 1){
        		let startTime = new Date(data.data.startTime).getTime();
        		let endTime = new Date(data.data.endTime).getTime();
        		let duration = Math.floor((endTime-startTime)/1000);
        		this.duration = Math.floor((endTime-startTime)/1000);
        		console.log('演练时间'+this.duration);
        		this.formValidate.duration = duration || 1;
        	}
        })
        this.getTaskList({
            "testId":this.currentSceneId,
			"page":this.taskCurrentPage,
			"rows":this.taskItemPage,
            "taskType":this.taskTypeTable,
            "taskMode":this.currentTaskMode,
        });
        // this.currentProjectId = this.$route.params.username
    },
    beforeDestroy(){
    	clearTimeout(this.headerData.serintervalTimeFun)
    },
    methods: {
        commitTask(){
            let _this = this;
            if(this.peopleValue.length==0){
                this.$Message.info("请选择人员")
                return;
            }
            if(this.currentDevice.length==0){
                this.$Message.info("请选择设备")
                return;
            }
            for(let i=0;i<this.peopleValue.length;i++){
                let element = _this.peopleValue[i];
                for(let j=0;j<_this.currentDevice.length;j++){
                    let obj = {};
                    obj['accessGroupId'] = element.split(',')[0]
                    obj['userId'] = element.split(',')[1]
                    obj['deviceId'] = _this.currentDevice[j]
                    obj['testId'] = _this.$route.query.id
                    _this.currentUsers.push(obj)
                    if(_this.userDeciceGroupId.length!=0){
                        if(_this.userDeciceGroupId.indexOf(element.split(',')[0]+','+element.split(',')[1]+','+_this.currentDevice[j])==-1){
                            _this.userDeciceGroupId.push(element.split(',')[0]+','+element.split(',')[1]+','+_this.currentDevice[j])
                            _this.formValidate.selectedVmData.push({
                                "name":_this.getNameFormId[element.split(',')[0]] +'/'+_this.getNameFormId[element.split(',')[1]]+'/'+_this.getNameFormId[_this.currentDevice[j]],
                                "id":element.split(',')[0]+','+element.split(',')[1]+','+_this.currentDevice[j]
                            })
                        }
                    }else{
                        _this.userDeciceGroupId.push(element.split(',')[0]+','+element.split(',')[1]+','+_this.currentDevice[j])
                        _this.formValidate.selectedVmData.push({
                            "name":_this.getNameFormId[element.split(',')[0]] +'/'+_this.getNameFormId[element.split(',')[1]]+'/'+_this.getNameFormId[_this.currentDevice[j]],
                            "id":element.split(',')[0]+','+element.split(',')[1]+','+_this.currentDevice[j]
                        })
                    }
                }
            }
            this.peopleValue = [];
            this.formValidate.group = '';
            this.currentDevice = [];
            this.networkArr = [];
        },
        getMsgFormSon(data){
            this.propertiesData = data;
        },
        configerManage(){
            this.taskConfigerMess = true
            this.$refs.qgawrite.getQgaWriteInfoList()
        },
        clickEvent: function(){
            // console.log('--')
            // console.log(this.headerData)
            // this.$emit("success",this.taskTypeTableTitle)
            // this.loadConfiguration(this.taskTypeTable)
            // this.loadConfiguration("qga_write")
        },
        handleSelectAll (status) {
            this.$refs.selection.selectAll(status)
        },
        createFlagTask(){
            this.judgePanelType = true
            this.$refs['formValidate'].resetFields();
            this.vmCurrentPage = 1
            this.vmItemPage = 10
            this.formValidate.configer = "";
            this.formValidate.vmName = "";
            this.formValidate.vmIP = "";
            this.formValidate.secret = "";
            this.formValidate.expireTime = 180;
            this.formValidate.group = "";
            this.formValidate.duration = this.duration;
            this.configurationData = [];
            this.peopleValue = [];
            this.networkId = '';
            this.judgeVmStatus()
            // this.loadConfiguration("qga_write")
            this.propertiesData = [{
                key:null,
                value:null,
            }];
            // this.getVmList({page:this.vmCurrentPage,rows:this.vmItemPage,projectId:this.currentProjectId,order:"asc",sortBy:"name",name:this.formValidate.vmName,ip:this.formValidate.vmIP})
            this.createFlagTaskModal = true;
            // this.formValidate.name = "";

            this.formValidate.desc = ""
            // this.selectedVmDataTable = []
            this.selectedVmDataTable = []
            this.formValidate.selectedVmData = []
            this.currentUsers = []//保存时数据
            this.userDeciceGroupId= [];
            this.getAccessUserGroup();
            this.getProjectSubnet();
//          this.getDeviceList();
			this.refreshVmList();
        },
        ok(){
            this.handleSubmit('formValidate')
        },
        cancel(){
            //  this.$Message.info('Clicked cancel')
        },
        dealAutoConfigData(){
        	//循环接入组
        	let index = 0;
        	let flagUsers = [];
        	this.accessGroupList.forEach(group => {
        		//获取接入组用户分配机器的子网络
        		this.getAvailableNetwork(JSON.stringify(group)).then(networks => {
        			let users = group.userList;
        			let vms = [];
        			console.log(networks, this.dataVmList.map(vm => vm.networkId),this.dataVmList.map(vm => vm.networkName));
	        		if(networks && networks.length > 0){
	        			//获取子网络机器
	        			console.log(this.dataVmList);
	        			vms = this.dataVmList.filter(vm => networks.includes(vm.networkId)).map(vm => vm.id);
	        		}
	        		if(vms.length > 0 && users.length > 0){
	        			for(let i = 0;i<users.length;i++){
		        			for(let j=0;j<vms.length;j++){
		        				flagUsers.push({
		        					accessGroupId:group.id,
		        					userId:users[i].userId,
		        					deviceId:vms[j],
		        					testId:this.$route.query.id
		        				})
		        			}
		        		}
	        		}
	        		index ++;
	        		if(index == this.accessGroupList.length && flagUsers.length > 0){
	        			this.flagUsers = flagUsers;
	        			this.canAutoConfig = true;
	        		}else{
	        			this.canAutoConfig = false;
	        		}
	        	})
        	});
        },
        autoConfig(){
        	if(this.canAutoConfig){
    			//保存配置
    			this.saveoutbandTask({
                    name:'Flag单次提交',
                    // configId:$this.formValidate.configer,
                    description:'',
                    taskMode:this.formValidate.taskMode,
                    // deviceIdList :$this.selectedVmDataTable,
                    deviceType:"VM",
                    taskType:this.taskTypeTable,
                    testId:this.currentSceneId,
                    duration:this.formValidate.duration,
                    flagUsers:this.flagUsers,
                    // metadata:{
                    //     users:$this.currentUsers
                    // },
                    properties:{},
                })
    		}
        },
        handleSubmit (name) {
            let $this = this;
            this.properties = {};
            if(this.propertiesData.length!=0){
                let attrData = $this.propertiesData;
                for (let index = 0; index < attrData.length; index++) {
                    const element = attrData[index];
                    if(element.key){
                        $this.properties[element.key] = element.value;
                    }
                }
            }
            $this.$refs[name].validate((valid) => {
                if (valid) {
                	console.log($this.currentUsers)
                    // $this.$Message.success('Success!');
                    if($this.currentUsers.length!=0){
                        if($this.judgePanelType){//判断是保存还是修改
                            $this.saveoutbandTask({
                                name:$this.formValidate.name,
                                // configId:$this.formValidate.configer,
                                description :$this.formValidate.desc,
                                taskMode:$this.formValidate.taskMode,
                                // deviceIdList :$this.selectedVmDataTable,
                                deviceType:"VM",
                                taskType:$this.taskTypeTable,
                                testId:$this.currentSceneId,
                                duration:$this.formValidate.duration,
                                flagUsers:$this.currentUsers,
                                // metadata:{
                                //     users:$this.currentUsers
                                // },
                                properties:$this.properties,
                            })
                        }else{
                            $this.amendTask({
                                name:$this.formValidate.name,
                                description :$this.formValidate.desc,
                                taskMode:$this.formValidate.taskMode,
                                // deviceIdList :$this.selectedVmDataTable,
                                deviceType:"VM",
                                taskType:$this.taskTypeTable,
                                testId:$this.currentSceneId,
                                duration:$this.formValidate.duration,
                                // metadata:{
                                //     users:$this.currentUsers
                                // },
                                flagUsers:$this.currentUsers,
                                properties:$this.properties,
                            })
                        }
                    }else{
                        $this.$Message.info("请选择人员设备")
                        $this.createFlagTaskModalLoading = false;
                        $this.$nextTick(() => {
                            $this.createFlagTaskModalLoading = true;
                        });
                    }

                } else {
                    $this.createFlagTaskModalLoading = false;
                    $this.$nextTick(() => {
                        $this.createFlagTaskModalLoading = true;
                    });
                }

            });
        },
        handleReset (name) {
            this.$refs[name].resetFields();
        },
        addVmAfterTable(param){
            let data = this.dataVmList;
            $.each(this.dataVmList,function(i,item){
                if(item.id==param.id){
                    item._checked = true;
                    item._disabled = true;
                }
            })
        },
        handleAdd () {
            // if (this.selectedVmData.length) {
            //     this.selectedVmData.push(this.count[this.count.length - 1] + 1);
            // } else {
            //     this.selectedVmData.push(0);
            // }
        },
        handleClose2 (event, name) {
            // console.log(event)
            console.log(name);
            let $this = this;
            let data = this.formValidate.selectedVmData;
            $this.selectedDataConfiger = [];
            let _data = this.selectedVmDataTable;
            let _datai = $this.selectedVmDataTable.findIndex(vmId => vmId == name);
            _data.splice(_datai,1);
            $.each(data,function(i,item){
                if(item){
                    if(item.id==name){
                        data.splice(i,1);
                    }
                }
            });
            $.each(this.userDeciceGroupId,(i,item) => {
                if(item){
                    if(item==name){
                        this.userDeciceGroupId.splice(i,1);
                    }
                }
            });
            $.each($this.currentUsers,function(i,item){
                console.log(item);
                if(item){
                    console.log(item.accessGroupId+','+item.userId+','+item.deviceId)
                    if(item.accessGroupId+','+item.userId+','+item.deviceId==name){
                        $this.currentUsers.splice(i,1);
                        console.log('--------------')
                    }
                }
            });
        },
        judgeVmStatus(){
            let data = this.dataVmList;
            let data_ = this.selectedVmDataTable
            // console.log(data_)
            //$.each(data,function(i,item){
            data.forEach(function(item,i){
                // console.log(item.id)
                if(data_.indexOf(item.id)!=-1){
                    // alert('-')
                    item._checked = true;
                    item._disabled = true;
                }else{
                    item._checked = false;
                    item._disabled = false;
                }
            })
        },
        loadConfiguration(operation){
            let $this= this;
//          axios({
//              url:this.GLOBAL._projPath_resTasktemplate +"item?"+this.BASE.getParamStr({
//                  "operation":operation
//              }),
//          })
            loadItemConfiguration({ "operation":operation}).then((response)=>{
                $this.configurationData = [];
                if(response.code==1||response.code==0){
                    let ConfigurationList = response.data.list;
                    if(ConfigurationList==""){
                        return;
                    }
                    $.each(ConfigurationList, function(i,item) {
                        $this.configurationData.push({
                            name:item.name,
                            id:String(item.id),
                        })
                    });
                }else{
                    $this.$Message.error(response.prompt)
                }
            })
        },
        getVmList(getParamObj){
            let $this = this;
			return new Promise((resolve,reject) => {
			queryVmWithParty(this.$route.query.prjid,getParamObj).then((response)=>{
                $this.dataVmList = [];
                if(response.code==1){
                    let vmData = response.data.list;
                    $this.vmTotal = Number(response.data.count);
                    let disabled_ = false;
                    let checked_ = false;
                    this.getTargetTeamList().then(targetList => {
                    	let targetIds = targetList.map(target => target.vmId);
	                    vmData.forEach(function(item,i){
	                        if($this.selectedVmDataTable.length!=0){
	                            if($this.selectedVmDataTable.indexOf(item.id)!=-1){
	                                disabled_ = true
	                                checked_ = true
	                            }else{
	                                disabled_ = false
	                                checked_ = false
	                            }
	                        }else{
	                            disabled_ = false
	                            checked_ = false
	                        }
	                        console.log(item.name,item.id,targetIds.includes(item.id));
	                        if(targetIds.includes(item.id)){
	                        	console.log(item.id)
//	                        	let networkId = $this.subnetList.filter(subnet => subnet.id == item.networkid)[0].id;
//	                        	let networkName = $this.subnetList.filter(subnet => subnet.id == item.networkid)[0].name;
		                        $this.dataVmList.push({
		                            name:item.name,
		                            id:item.id,
		                            sysType:item.sysType,
		                            networkId:item.networkId,
		                            networkName:item.networkName,
		                            profile:item.profile = item.profile ? item.profile :'',
		                            IP:item.address.map((item)=>item.ips.map(ip => ip.ipAddress).join(',')),
		                            _disabled: disabled_,
		                            _checked:checked_,

		                        })
//		                        console.log(networkName);
		                        $this.getNameFormId[item.id] = item.networkName +'/'+item.name;
	                        }
	                    })
	                    resolve();
                    })
                }
            })
			})
        },
        switchineVmCurrentPage(numberPage){
            this.vmCurrentPage = numberPage;
            this.getVmList({page:this.vmCurrentPage,rows:this.vmItemPage,projectId:this.currentProjectId,order:"asc",sortBy:"name",name:this.formValidate.vmName,ip:this.formValidate.vmIP,findPorts:true})
        },
        switchVmItemPage(numberSize){
            this.vmItemPage = numberSize
            this.getVmList({page:this.vmCurrentPage,rows:this.vmItemPage,projectId:this.currentProjectId,order:"asc",sortBy:"name",name:this.formValidate.vmName,ip:this.formValidate.vmIP,findPorts:true})
        },
        saveoutbandTask(saveDateJson){
            let $this = this;
//          axios({
//              url:this.GLOBAL._projPath_process+"custom/tasks",
//              method:'post',
//              data:saveDateJson
//          }).
            saveoutbandTask(saveDateJson).then((response)=>{
                if(response.code==1){
                    $this.createFlagTaskModal = false;
                    $this.$Message.success('添加任务成功');
                    $this.getTaskList({
                        "testId":$this.currentSceneId,
                        "page":$this.taskCurrentPage,
                        "rows":$this.taskItemPage,
                        "taskType":$this.taskTypeTable,
                        "taskMode":$this.currentTaskMode,
                    })
                    $this.createFlagTaskModalLoading = false;
                    $this.$nextTick(() => {
                        $this.createFlagTaskModalLoading = true;
                    });
                    //$this.$parent.getStatisticsList();
                }else{
                    $this.$Message.error(response.message);
                    $this.createFlagTaskModalLoading = false;
                    $this.$nextTick(() => {
                        $this.createFlagTaskModalLoading = true;
                    });
                }
            })
        },
        getTaskList(obj){
            let $this = this;
            clearTimeout($this.headerData.serintervalTimeFun)
//          axios({
//              url:this.GLOBAL._projPath_process +"custom/tasks?"+this.BASE.getParamStr(obj),
//          }).
            getTaskList(obj).then((response)=>{
                if(response.code==1){
                    $this.taskData = [];
                    $this.taskTotal = response.data.total;
                    let setintrvalBol = false
                    // let _s = 0,_e = 0,_i = 0,_r = 0,stintervalBol = false;
                    //if(response.data.list.length!=0){
                    if(response.data.items.length!=0){
                        // $this.taskData = reponse.data.list;
                        $this.taskData = response.data.items.map((item)=>{
                            if($this.selectedData.map((item)=>item.id).join(',').indexOf(item.id)!=-1){
                                item['_checked'] = true;
                            }else{
                                item['_checked'] = false;
                            }
                            return item;
                        });
                        $.each(response.data.items,function(i,item){
                            if(item.status=="running"||item.status=="starting"||item.status=="closing"){
                                // _r++;
                                setintrvalBol = true;
                            }
                        })
                    }
                    if(setintrvalBol){
                        // $this.headerData.serintervalTimeFun  = setInterval( $this.setintervalTaskList, 2000);
                        $this.headerData.serintervalTimeFun  = setTimeout(() => {
                            $this.getTaskList({
                                "testId":$this.currentSceneId,
                                "page":$this.taskCurrentPage,
                                "rows":$this.taskItemPage,
                                "taskType":$this.taskTypeTable,
                                "taskMode":$this.currentTaskMode,
                            });
                        }, 2000);
                    }else{
                        clearTimeout($this.headerData.serintervalTimeFun)
                        // $this.setintervalTaskList();
                    }
                    // $this.getTaskListDeailData()
                    // $this.$emit("success",$this.taskTypeTableTitle+'-'+_s+'-'+_e+'-'+_i+'-'+_r+'-'+stintervalBol+'-'+$this.taskCurrentPage+'-'+$this.taskItemPage)
                }else if(response.code==-2){

                }else{
                    $this.$Message.error(response.message)
                }
            })
        },
        switchineTaskCurrentPage(numberPage){
            this.taskCurrentPage = numberPage;
            this.getTaskList({
                "testId":this.currentSceneId,
                "page":this.taskCurrentPage,
                "rows":this.taskItemPage,
                // "configType":"",
                "taskType":this.taskTypeTable,
                "taskMode":this.currentTaskMode,
            })
        },
        switchTaskItemPage(numberSize){
            this.taskItemPage = numberSize
            this.getTaskList({
                "testId":this.currentSceneId,
                "page":this.taskCurrentPage,
                "rows":this.taskItemPage,
                // "configType":"",
                "taskType":this.taskTypeTable,
                "taskMode":this.currentTaskMode,
            })
        },
        deleteTask(taskId){
            let $this = this
//          axios({
//              url:this.GLOBAL._projPath_process +"custom/tasks/"+taskId,
//              method:'delete'
//          }).
            deleteTask(taskId).then((response)=>{
                if(response.code==1){
                    if(response.data[0].code==1){
                        $this.getTaskList({
                            "testId":$this.currentSceneId,
                            "page":$this.taskCurrentPage,
                            "rows":$this.taskItemPage,
                            "taskType":$this.taskTypeTable,
                            "taskMode":$this.currentTaskMode,
                        })
                        $this.$Message.success("删除成功")
                        //$this.$parent.getStatisticsList();
                    }else{
                        $this.$Message.error(response.data[0].message)
                    }

                }else{
                    $this.$Message.error(response.data[0].message)
                }
            })
        },
        updateTask(taskId){
            this.judgePanelType = false
            this.formValidate.vmName = "";
            this.formValidate.vmIP = "";
            this.formValidate.group = "";
            this.formValidate.duration = this.duration;
            let $this = this ,_this = this;
            this.networkId = '';
            this.getProjectSubnet();
//          this.refreshVmList();
//          axios({
//              url:this.GLOBAL._projPath_process +"custom/tasks/"+taskId,
//          }).
            taskDetail(taskId).then((response)=>{
                if(response.code==1){
                    $this.workingAreaTaskId = response.data.id
                    $this.selectedVmDataTable = [];
                    $this.formValidate.selectedVmData = [];
                    $this.propertiesData = [];
                    $this.currentUsers = [];
                    $this.createFlagTaskModal = true;
                    $this.formValidate.name = response.data.name;
                    $this.formValidate.desc = response.data.description;
                    // $this.formValidate.expireTime = String(response.data.metadata.expireTime);
                    // $this.formValidate.secret = response.data.metadata.secret;
                    Promise.all([$this.getAccessUserGroup(),$this.refreshVmList()]).then(data => {
                    	console.log(_this.getNameFormId)
                    	if(response.data.flagUsers&&response.data.flagUsers.length!=0){
                            for(let i=0;i<response.data.flagUsers.length;i++){
                            	console.log(response.data.flagUsers[i].deviceId,response.data.flagUsers[i].deviceName);
                                $this.formValidate.selectedVmData.push({
                                    "name":_this.getNameFormId[response.data.flagUsers[i].accessGroupId] +'/'+_this.getNameFormId[response.data.flagUsers[i].userId]+'/'+_this.getNameFormId[response.data.flagUsers[i].deviceId],
                                    "id":response.data.flagUsers[i].accessGroupId+','+response.data.flagUsers[i].userId+','+response.data.flagUsers[i].deviceId
                                })
                                $this.userDeciceGroupId.push(response.data.flagUsers[i].accessGroupId+','+response.data.flagUsers[i].userId+','+response.data.flagUsers[i].deviceId)
                                let obj = {};
                                obj['accessGroupId'] = response.data.flagUsers[i].accessGroupId
                                obj['userId'] = response.data.flagUsers[i].userId
                                obj['deviceId'] = response.data.flagUsers[i].deviceId
                                obj['testId'] = this.$route.query.id
                                _this.currentUsers.push(obj)
                            }
                        }
                    })
                    //$this.getAccessUserGroup();
//                  setTimeout(() => {
//                      console.log(_this.getNameFormId)
//                      if(response.data.users&&response.data.users.length!=0){
//                          for(let i=0;i<response.data.users.length;i++){
//                              $this.formValidate.selectedVmData.push({
//                                  "name":_this.getNameFormId[response.data.users[i].accessGroupId] +'/'+_this.getNameFormId[response.data.users[i].userId]+'/'+_this.getNameFormId[response.data.users[i].deviceId],
//                                  "id":response.data.users[i].accessGroupId+','+response.data.users[i].userId+','+response.data.users[i].deviceId
//                              })
//                              $this.userDeciceGroupId.push(response.data.users[i].accessGroupId+','+response.data.users[i].userId+','+response.data.users[i].deviceId)
//                              let obj = {};
//                              obj['accessGroupId'] = response.data.users[i].accessGroupId
//                              obj['userId'] = response.data.users[i].userId
//                              obj['deviceId'] = response.data.users[i].deviceId
//                              _this.currentUsers.push(obj)
//                          }
//                      }
//                  }, 1500);
                    // if(response.data.metadata){
                    //     // $this.configerParams = true;
                    //     $this.formValidate.category = response.data.metadata.category ?  response.data.metadata.category: ''
                    //     $this.formValidate.path = response.data.metadata.path ? response.data.metadata.path:''
                    //     $this.formValidate.type = response.data.metadata.type ? response.data.metadata.type:''
                    //     $this.formValidate.content = response.data.metadata.content ? response.data.metadata.content: ''
                    //     $this.formValidate.osType = response.data.metadata.osType ? response.data.metadata.osType :''
                    //     $this.metadataConfigerInfor =  response.data.metadata;
                    // }
                    // $this.getVmList({page:$this.vmCurrentPage,rows:$this.vmItemPage,projectId:$this.currentProjectId,order:"asc",sortBy:"name",name:$this.formValidate.vmName,ip:$this.formValidate.vmIP,sysType:$this.configerSystype})
                    // if(response.data.deviceData.length!=0){
                    //     $.each(response.data.deviceData,function(i,item){
                    //         $this.selectedVmDataTable.push(item.deviceId);
                    //         $this.formValidate.selectedVmData.push({
                    //             name:item.deviceName,
                    //             id:item.deviceId
                    //         })
                    //     })
                    // }
                    $this.formValidate.taskMode = response.data.taskMode;
                    if(JSON.stringify(response.data.properties)!="{}"){
                        for(let i in response.data.properties){
                            let obj = {};
                            obj['key'] = i;
                            obj['value'] = response.data.properties[i];
                            $this.propertiesData.push(obj)
                        }
                    }
                }else{
                    $this.workingAreaTaskId = ""//清空任务id
                    $this.$Message.error(response.message)
                }
            }).then(()=>{
                $this.loadConfiguration("qga_write")
                // $this.getVmList({page:this.vmCurrentPage,rows:this.vmItemPage,projectId:this.currentProjectId,order:"asc",sortBy:"name",name:this.formValidate.vmName,ip:this.formValidate.vmIP})
                $this.judgeVmStatus()
            })
        },
        amendTask(amendTaskData){
            let $this = this;
//          axios({
//              url:this.GLOBAL._projPath_process+"custom/tasks/"+this.workingAreaTaskId,
//              method:'put',
//              data:amendTaskData
//          })
            amendTask(this.workingAreaTaskId,amendTaskData).then((response)=>{
                if(response.code==1){
                    $this.createFlagTaskModal = false;
                    $this.$Message.success("修改成功");
                    $this.getTaskList({
                        "testId":$this.currentSceneId,
                        "page":$this.taskCurrentPage,
                        "rows":$this.taskItemPage,
                        "taskType":$this.taskTypeTable,
                        "taskMode":$this.currentTaskMode,
                    })
                    $this.createFlagTaskModalLoading = false;
                    $this.$nextTick(() => {
                        $this.createFlagTaskModalLoading = true;
                    });
                }else{
                    $this.$Message.error(response.message)
                    $this.createFlagTaskModalLoading = false;
                    $this.$nextTick(() => {
                        $this.createFlagTaskModalLoading = true;
                    });
                }
            })
        },
        activeTask(taskId,active){
            let $this = this
            if(active=="开始"){
                active = "start"
            }else if(active=="停止"){
                active = "stop"
            }
//          axios({
//              url:this.GLOBAL._projPath_process +"custom/tasks/"+taskId+'/execute?operation='+active,
//              method:'post'
//          }).
            activeTask(taskId,active).then((response)=>{
                let activeType;
                if(response.code==1){
                    $this.$Message.success(`${active === 'start' ? '开始' : '停止'}任务成功`)
                    $this.getTaskList({
                        "testId":$this.currentSceneId,
                        "page":$this.taskCurrentPage,
                        "rows":$this.taskItemPage,
                        "taskType":$this.taskTypeTable,
                        "taskMode":$this.currentTaskMode,
                    });
                }else{
                    $this.$Message.error(response.message)
                }
            })
        },
        taskDeail(taskId){
            let $this = this
//          axios({
//              url:this.GLOBAL._projPath_process +"custom/tasks/"+taskId+'/histories',
//          }).
            getFlagOnceDetail(taskId).then((response)=>{
                if(response.code==1){
                    $this.taskDeailData = response.data;
                    $this.taskDeailModal = true
                    // $this.taskDeailData= reponse.data;
//                  $.each(response.data,function(i,item){
//                      $this.taskDeailData.push({
//                          deviceName:item.deviceName,
//                          status:item.status,
//                          message:item.message,
//                          deviceId:item.deviceId,
//                          host:'',
//                          hostIp:'',
//                          instance:'',
//                          osId:'',
//                          IP:'',
//                          cidr:'',
//                          created:item.created ? item.created:'',
//                          updated:item.updated ? item.updated:'',
//                          _expanded:false
//                      })
//                  })
                }else{
                    $this.$Message.error(response.message)
                }
            })
        },
        deleteManyTask(selection){
            let $this = this;
            if(this.selectedData.length==0){
                this.$Message.error("请选择要删除的任务")
            }else{
//              axios({
//                  url:this.GLOBAL._projPath_process +"custom/tasks/"+this.selectedData.map((item)=>item.id).join(','),
//                  method:'delete'
//              }).
                deleteManyTask(this.selectedData.map((item)=>item.id).join(',')).then((response)=>{
                    if(response.code==1){
                        $.each(response.data,function(i,item){
                            if(item.code==1){
                                $this.$Message.success("删除成功")
                            }else{
                                $this.$Message.error(item.message)
                            }
                        })
                        $this.getTaskList({
                            "testId":$this.currentSceneId,
                            "page":$this.taskCurrentPage,
                            "rows":$this.taskItemPage,
                            "taskType":$this.taskTypeTable,
                            "taskMode":$this.currentTaskMode,
                        })
                    }else{
                        $this.$Message.error(response.message)
                    }
                })
            }
        },
        getSelectedTableItem(selection){
            this.selectedData = [];
            this.selectedData = selection

            console.log(selection)
        },
        hostDeail(row){
            console.log(row.deviceId);
            let $this  = this;
            if(!row._expanded){
//              axios({
//                  url:this.GLOBAL._projPath_deploy+"project/servers/"+row.deviceId,
//              }).
                hostDetail(row.deviceId).then((response)=>{
                    if(response.code==1){
                        $.each($this.taskDeailData,function(i,item){
                            if(row.id==item.id){
                                item._expanded = true
                                item.host = response.data.host;
                                item.hostIp = response.data.hostIp;
                                item.instance = response.data.instanceName;
                                item.osId= response.data.cloudId;
                                item.IP = response.data.addresses.map((item)=> item.ips.map(ip => ip.ipAddress).join(','))
                                item.cidr = response.data.addresses.map((item)=> item.ips.map(ip => ip.cidr).join(','))
                                return false;
                            }
                        })
                    }
                })
            }else{
                row._expanded = !row._expanded;
            }
        },
        // setintervalTaskList(obj){
        //     let $this = this;
        //     $.ajax({
        //         type:"get",
        //         url:_projPath_process +"custom/tasks?"+GlobalTool.getParamStr(obj),
        //         async:true,
        //         dataType:"json",
        //         headers:{"Authorization":localStorage.token},
        //         contentType:"application/json",
        //         success:function(reponse){
        //             if(reponse.code==1){
        //                 if(reponse.data.list.length!=0){
        //                     $.each(reponse.data.list,function(i,item){

        //                     })
        //                     $this.taskData = reponse.data.list;
        //                 }
        //             }else if(reponse.code==-2){

        //             }else{
        //                 $this.$Message.error(response.message)
        //             }
        //         },
        //         error:function(){
        //             $this.$Message.error(errorMessage)
        //         }
        //     });
        // },
        refreshTaskList(){
            this.getTaskList({
                "testId":this.currentSceneId,
                "page":this.taskCurrentPage,
                "rows":this.taskItemPage,
                "taskType":"",
                "taskMode":this.currentTaskMode,
            });
        },
        refreshVmList(){
           return  this.getVmList({
                page:this.vmCurrentPage,
                rows:this.vmItemPage,
                projectId:this.currentProjectId,
                order:"asc",
                sortBy:"name",
                name:this.formValidate.vmName,
                ip:this.formValidate.vmIP,
                findPorts:true
            })
        },
        getTaskListDeailData(){
            let $this = this
//          axios({
//              url:this.GLOBAL._projPath_process +"overview/task/countByStatus?"+this.BASE.getParamStr({
//                  "testId":$this.currentSceneId,
//                  "taskType":$this.taskTypeTable,
//                  "node":"false"
//              }),
//          })
            let params = {
            	"testId":$this.currentSceneId,
                "taskType":$this.taskTypeTable,
                "node":"false"
            }
            getTaskListDetailData(params).then((response)=>{
                if(response.code==1){
                    let _s = 0,_e = 0,_i = 0,_r = 0,stintervalBol = false;
                    _s = response.data.completed;
                    _e = response.data.error;
                    _i = response.data.initialized;
                    _r = Number(response.data.running)+Number(response.data.starting)+Number(response.data.closing);
                    if(_r!=0){
                        stintervalBol = true;
                    }
                    $this.$emit("success",$this.taskTypeTableTitle+'-'+_s+'-'+_e+'-'+_i+'-'+_r+'-'+stintervalBol+'-'+$this.taskCurrentPage+'-'+$this.taskItemPage)
                }else if(response.code==-2){

                }else{
                    $this.$Message.error(response.message)
                }
            })
        },
        setintervalTaskList(){
            // alert('-')
            let $this = this;
//          axios({
//              url:this.GLOBAL._projPath_process +"custom/tasks?"+this.BASE.getParamStr({
//                  "testId":this.currentSceneId,
//                  "page":this.taskCurrentPage,
//                  "rows":this.taskItemPage,
//                  "taskType":this.taskTypeTable,
//                  "node":"false"
//              }),
//          })
            let params = {
            	"testId":this.currentSceneId,
                "page":this.taskCurrentPage,
                "rows":this.taskItemPage,
                "taskType":this.taskTypeTable,
                "node":"false"
            }
            getTaskList(params).then((response)=>{
                if(response.code==1){
                    $this.taskData = [];
                    if(response.data.list.length!=0){
                        let stintervalBol  = false
                        $this.taskData = response.data.list
                        $.each(response.data.list,function(i,item){
                            if(item.status=="running"||item.status=="starting"||item.status=="closing"){
                                stintervalBol = true
                            }
                            $this.taskData[i].status = item.status;
                        })
                        if(!stintervalBol){
                            clearTimeout($this.headerData.serintervalTimeFun)
                        }
                    }
                    $this.getTaskListDeailData()
                }else if(response.code==-2){

                }else{
                    $this.$Message.error(response.message)
                }
            })
        },
        addSelectedData(){
            let that = this,bol = true;
            $.each(that.selectedDataConfiger,function(i,item){
                console.log(item)
                if(that.selectedVmDataTable.indexOf(item.id)!=-1){

                }else{
                    bol = false
                    that.addVmAfterTable(item)
                    that.selectedVmDataTable.push(item.id)
                    that.formValidate.selectedVmData.push({
                        "name":item.name,
                        "id":item.id
                    })
                }
            })
            if(bol){
                that.$Message.info("请选择要添加的内容")
            }
        },
        getSelectedData(selection){
            // console.log(selection)
            this.selectedDataConfiger = [];
            this.selectedDataConfiger = selection;
        },
        /**
         * @description: 鼠标移上配置显示详情
         * @param {type}
         * @return:
         */
        mouseOverConfiger(e,value){
            clearTimeout(this.optionHoverEvent)
            let _this = this;
            this.optionHoverEvent = setTimeout(() => {
                if(this.hoverCdraBol){
                    return;
                }
                this.configurationInformation = true
                this.cardPanelLeft = e.layerX +30+ 'px'
                this.cardPanelTop = e.layerY +35+'px'
                //查询配置详细信息
//              axios({
//                  url: '/tasktemplate/item/' + value,
//                  method: 'get',
//              })
                showConfiguration(value).then(function (response) {
                    if(response.code != '1'){
                        _this.$Message.warning(response.prompt);
                    }else{
                        _this.configPanel.configName = response.data.name
                        _this.configPanel.configPath = response.data.data.path
                        _this.configPanel.configSystype = response.data.data.osType
                        _this.configPanel.configContent = response.data.data.content
                        _this.configPanel.configDescription = response.data.description
                        _this.configPanel.configCreateTime = response.data.createTime
                        _this.configPanel.configCreatorName = response.data.creatorName

                    }
                });
            }, 300);
        },
        mouseLeaveConfiger(ev,value){
            clearTimeout(this.optionOutEvent)
            this.optionOutEvent = setTimeout(() => {
                if(!this.hoverCdraBol){
                    this.configurationInformation = false
                    this.cardPanelLeft = '0'
                    this.cardPanelTop = '0'
                }
            }, 300);
        },
        showConfiguration(value){
            this.configurationInformation = false
            this.selectedVmDataTable = [];
            this.formValidate.selectedVmData = [];

            let _this = this;
            if(value){
//              axios({
//                  url: '/tasktemplate/item/' + value,
//                  method: 'get',
//              }).
                showConfiguration(value).then(function (response) {
                    if(response.code != '1'){
                        _this.$Message.warning(response.prompt);
                        _this.configerParams = false;
                    }else{
                        // _this.configerParams = true;
                        _this.formValidate.category = response.data.category ?  response.data.category: ''
                        _this.formValidate.path = response.data.data.path ? response.data.data.path:''
                        _this.formValidate.type = response.data.data.type ? response.data.data.type:''
                        _this.formValidate.content = response.data.data.content ? response.data.data.content: ''
                        _this.formValidate.osType = response.data.data.osType ? response.data.data.osType :''
                        _this.metadataConfigerInfor =  response.data.data;
                        _this.configPanel.configName = response.data.name;
                        _this.metadataConfigerInfor['configurationName'] = response.data.name;
                        _this.configerSystype = response.data.data.osType;
                        _this.getVmList({page:_this.vmCurrentPage,rows:_this.vmItemPage,projectId:_this.currentProjectId,order:"asc",sortBy:"name",name:_this.formValidate.vmName,ip:_this.formValidate.vmIP,sysType:_this.configerSystype,findPorts:true})

                    }
                });
            }else{
                _this.configerParams = false;
                _this.formValidate.category = ""
                _this.formValidate.path = ""
                _this.formValidate.type = ""
                _this.formValidate.content = ""
                _this.formValidate.osType = ""
                _this.configerSystype = "";
                _this.getVmList({page:_this.vmCurrentPage,rows:_this.vmItemPage,projectId:_this.currentProjectId,order:"asc",sortBy:"name",name:_this.formValidate.vmName,ip:_this.formValidate.vmIP,sysType:_this.configerSystype,findPorts:true})
            }
        },
        jinru(e){
            this.hoverCdraBol = true
        },
        yichu(e){
            this.hoverCdraBol = false
            this.configurationInformation = false
            this.cardPanelLeft = '0'
            this.cardPanelTop = '0'
        },
        ddd(e){
            e.preventDefault()
            e.stopPropagation();
        },
        overStyle(){
            this.boxShadow = '5px 5px 5px #ddd'
        },
        removeStyle(){
            this.boxShadow = ''
        },
        getAccessUserGroup(){
          return new Promise((resolve,reject) => {
            let _this = this;
            _this.getNameFormId = {};
            _this.vmAttributeData = [];
//          axios({
//              url:'process/accessGroups?&testId='+this.currentSceneId+'&pageIndex=1&pageSize=1000&order=asc&property=name',
//          }).
            let params = {
            	testId:this.currentSceneId,
            	pageIndex:1,
            	pageSize:1000,
            	order:'asc',
            	property:'name'
            }
            getaccessgrouplist(params).then((response)=>{
                if (response.code==1) {
                	this.accessGroupList = response.data.items.filter(group => group.userList.length > 0);
                    let data = response.data.items;
                    for (let index = 0; index < data.length; index++) {
                        const element = data[index];
                        _this.getNameFormId[element.id] = element.name
                        for(let j=0;j<element.userList.length;j++){
                            let elements = element.userList[j];
//                          let obj = {};
//                          obj['name'] = element.name
//                          obj['id'] = element.id;
//                          obj['userId'] = elements.userId;
//                          obj['userName'] = elements.userName;
                            _this.getNameFormId[elements.userId] = elements.userName
                            //_this.vmAttributeData.push(obj)
                        }
                    }
                    resolve();
                    //this.getDeviceList()
                } else {
                    this.$Message.error(response.message)
                }
            })
          })
        },
        getAccessGroupMember(group){
        	this.networkArr = [];
        	this.vmAttributeData = [];
        	this.peopleValue = [];
        	if(!group){
        		return
        	}
        	let element = JSON.parse(group);
        	for(let j=0;j<element.userList.length;j++){
                let elements = element.userList[j];
                let obj = {};
                obj['name'] = element.name
                obj['id'] = element.id;
                obj['userId'] = elements.userId;
                obj['userName'] = elements.userName;
                //_this.getNameFormId[elements.userId] = elements.userName
                this.vmAttributeData.push(obj)
            }
        	this.peopleValue = element.userList.map(user => {
        		return element.id + ',' + user.userId
        	})
        	if(this.type == 4 || this.type == 2){
        		this.getAvailableNetwork(group);
        	}
        },
        //查询场景下的特征码服务器列表
        getDeviceList(){
          this.currentDevice = [];
          return new Promise((resolve,reject) => {
            let _this = this;
//          axios({
//              url:'process/tests/'+this.currentSceneId+'/flag/devices',
//              method:'get',
//          }).
            let params = {
				pageIndex:1,
				pageSize:2147483647,
				sceneId:this.$route.query.id,
//					projectId:this.$route.query.prjid
			}
//          if(this.networkId){
//				params.networkId = this.networkId;
//			}
            queryTargetAllot(params).then((response)=>{
                if (response.code==1) {
                    this.deviceList = response.data.items || data.data;
                    for(let i=0;i<response.data.items.length;i++){
                        _this.getNameFormId[response.data.items[i].vmId] = response.data.items[i].subnetName+'/'+response.data.items[i].vmName
                    }
                    console.log(_this.getNameFormId)
                    resolve();
                } else {
                    this.$Message.error(response.message)
                }
            })
          })
        },
        getProjectInfo(){
			return new Promise((resolve,reject) => {
				getstatusbyprjid(this.$route.query.prjid).then(data => {
					if(data.code == 1){
						this.projectInfo = data.data;
						resolve();
					}
				})
			})
		},
		getTargetTeamList(){
    		return new Promise((resolve,reject) => {
				let params = {
					pageIndex:1,
					pageSize:2147483647,
					sceneId:this.$route.query.id,
//					projectId:this.$route.query.prjid
				}
//		  		getTargetTeamList_new(params).then(data => {
	            if(this.type == 2){ //夺旗
	            	queryCtfTargetAllot(params).then(data => {
			  			if(data.code==1){
			  				let targetList = data.data.items || data.data;
			  				resolve(targetList.filter(vm => vm.url && vm.isFixedFileFlag == '1' && vm.isNeedSubmitFlag == '1'));
			  			}else{

			  			}
			  		})
	            }else{
	            	queryTargetAllot(params).then(data => {
			  			if(data.code==1){
			  				let targetList = data.data.items || data.data;
			  				if(this.type == 4){ //渗透
			  					resolve(targetList.filter(vm => vm.isFixedFileFlag == '1' && vm.isNeedSubmitFlag == '1'));
			  				}else{
			  					resolve(targetList);
			  				}
			  			}else{

			  			}
			  		})
	            }
	  		})
	  	},
        getProjectSubnet(){
        	return new Promise((resolve, reject) => {
	    	queryNetworkList(this.$route.query.prjid,this.projectInfo.network.id).then(data => {
	    		if(data.code == 1){
	    			let subnetList = [];
	    			data.attribute.editorStage.childs.forEach(item => {
	    				subnetList = subnetList.concat(item.childs);
	    			})
	    			this.subnetList = subnetList.filter(subnet => subnet.dataType == 'NW');
	    			this.availableSubnetList = subnetList.filter(subnet => subnet.dataType == 'NW');
					resolve();
//	    			this.networkId = subnetList[0].id;
//	    			this.network = {
//	    				value:this.subnetList[0].id,
//	    				label:this.subnetList[0].name
//	    			}
//	    			this.getDeviceList();
	    		}
	    	})
	    	})
	    },
	    changeNetwork(networks){
        	this.currentDevice = this.dataVmList.filter(vm => networks.includes(vm.networkId)).map(vm => vm.id);
        	console.log(this.currentDevice);
        },
      	getAvailableNetwork(group){
//	    	let group = this.idwithName[groupId];
			this.unusableAutoConfig = false;
            return new Promise((resolve, reject) => {
	            group = JSON.parse(group);
		    	let userId =  group.userList.length > 0 ? group.userList[0].userId :'';
		    	if(!userId){
		    		if(this.unusableAutoConfig == true){
		    			return;
		    		}
		    		this.unusableAutoConfig = true;
		    		this.$Message.warning('该接入组下没有用户，请先添加用户');
		    		return;
		    	}
		    	if(this.type == 2){
		    		console.log(this.subnetList);
		    		resolve(this.availableSubnetList.filter(subnet => subnet.name == group.name).map(subnet => subnet.id));
		    	}else{
		    		getUserDevices(this.$route.query.id,[userId]).then(data => {
			    		let deviceId = data.data.length > 0 ? data.data[0].deviceId :''
			    		if(!deviceId){
			    			if(this.unusableAutoConfig == true){
				    			return;
				    		}
				    		this.unusableAutoConfig = true;
			    			this.$Message.warning('接入组下有用户没有分配机器，请先分配机器');
			    		    return;
			    		}
			    		hostDetail(deviceId).then(data => {
							if(data.code == 1){
		//						console.log(this.subnetList,data.data.networkId);
								this.availableSubnetList = this.subnetList.filter(sn => sn.id == data.data.networkId);
								this.networkArr = [data.data.networkId];
								resolve(this.networkArr);
				//				this.$set(vm,'networkName',data.data.networkName)
							}else{
								reject();
							}
						})
			    	})
		    	}
	        })
	    },
    },
    watch:{
        listenParam(){
            // console.log(this.buttonsName)
        }
    }
}

</script>
